<%--
  Created by IntelliJ IDEA.
  User: zzf
  Date: 2021/1/7
  Time: 16:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ include file="/public/header/permissionCommon.jspf" %>
<html>
<head>
    <title>老人信息管理</title>
    <style type="text/css">
        .layui-table-tips-main{display:none}
        .layui-table-tips-c{display:none}
        .layui-table-grid-down {display: none;}
    </style>
</head>

<body class="layui-layout-body">
<%--页面布局 头左右底部--%>
<div class="layui-layout layui-layout-admin">
    <!-- 头部和左侧导航 -->
    <div id="header"></div>
    <!--右侧主体区域-->
    <div class="layui-body" >
        <div class="layui-tab layui-tab-brief" lay-filter="DemoTab">
            <ul class="layui-tab-title">
                <li class="layui-this" lay-id="elderInfo">老人信息</li>
                <li lay-id="elderChangedInfo">历史变更记录</li>
            </ul>
            <div class="layui-tab-content">
                <%---------- 老人信息页面 ---------%>
                <div id="ElderInfoDiv" class="layui-tab-item layui-show">
                    <%----------- 搜索上传功能 ----------%>
                    <div class="SearchLoadElder" style="font-size: small">
                        <%----- 搜索功能 -----%>
                        姓名：
                        <div class="layui-inline">
                            <input class="layui-input" name="name" id="name" autocomplete="off" style="height: 30px;width:100px;margin-right: 10px">
                        </div>
                        服务机构：
                        <div class="layui-inline">
                            <input class="layui-input" name="serv_org" id="serv_org" autocomplete="off" style="height: 30px;width:150px">
                        </div>
                        医保ID：
                        <div class="layui-inline">
                            <input class="layui-input" name="ybid" id="ybid" autocomplete="off" style="height: 30px;width:150px">
                        </div>
                        等级：
                        <div class="layui-input-inline layui-form" style="width: 150px;margin-right: 15px">
                            <select name="level" id="level" lay-filter="level"  class="select">
                                <option value="">请选择失能等级</option>
                                <option value="一级">一级</option>
                                <option value="二级">二级</option>
                                <option value="三级">三级</option>
                                <option value="四级">四级</option>
                                <option value="五级">五级</option>
                                <option value="六级">六级</option>
                            </select>
                        </div>
                        <br><br>
                        人员性质：
                        <div class="layui-input-inline layui-form" style="width: 150px;margin-right: 15px">
                            <select name="catagory" id="catagory" lay-filter="catagory"  class="select">
                                <option value="">请选择人员性质</option>
                                <option value="居保">居保</option>
                                <option value="城保">城保</option>
                                <option value="离休干部">离休干部</option>
                                <option value="革命伤残军人">革命伤残军人</option>
                                <option value="帮困">帮困</option>
                            </select>
                        </div>
                        评估类型：
                        <div class="layui-input-inline layui-form" style="width: 150px;margin-right: 15px">
                            <select name="type" id="type" lay-filter="type"  class="select">
                                <option value="">请选择评估类型</option>
                                <option value="初次评估">初次评估</option>
                                <option value="状态评估">状态评估</option>
                                <option value="期末评估">期末评估</option>
                                <option value="复核评估">复核评估</option>
                            </select>
                        </div>
                        服务状态：
                        <div class="layui-input-inline layui-form" style="width: 150px;margin-right: 15px">
                            <select name="situation" id="situation" lay-filter="situation"  class="select">
                                <option value="">请选择评估类型</option>
                                <option value="有效正常">有效正常</option>
                                <option value="有效暂停">有效暂停</option>
                                <option value="无效去世">无效去世</option>
                                <option value="无效转出">无效转出</option>
                            </select>
                        </div>

                        <div class="layui-inline">
                            <button class="searchBtn" data-type="reload1" style="margin-left:10px;height:30px;width:85px;background-color: #009688;color: white;border: none;border-radius: 5px">
                                <i class="layui-icon layui-icon-search"> </i>
                                <div class="layui-inline" style="font-size: small;text-align:center;margin-top: -3px;margin-left: 5px;margin-right: 5px">搜 索</div>
                            </button>
                        </div>
                        <%-------------文件导出-------------%>
                        <div class="layui-inline" style="float: right">
                            <button class="layui-btn layui-btn-sm" id="exportExcel" name="exportExcel" style="width: 100px;float: right;border-radius: 5px;margin-left: 5px;margin-top: -40px;margin-right: 10px">
                                <i class="layui-icon layui-icon-export"></i>
                                <div class="layui-inline" style="font-size: small;text-align:center;margin-top: -3px">导出文件</div>
                            </button>
                        </div>
                        <%-------------文件导入-------------%>
                        <div class="layui-inline" style="float: right">
                            <button type="button" class="layui-btn layui-btn-sm layui-btn-normal" id="uploadExcel" style="width: 100px;float: right;border-radius: 5px;margin-left: 5px;font-size:small; margin-right: 10px">
                                <i class="layui-icon layui-icon-upload-drag"></i>
                                &nbsp上传文件
                            </button>
                        </div>
                            <%-------------新增-------------%>
                            <div class="layui-inline" style="float: right">
                                <button class="searchBtn layui-btn layui-btn-sm"  data-type="Add" style="width: 100px;float: right;border-radius: 5px;margin-left: 5px;font-size:small; margin-right: 10px;background-color: #009688">
                                    <i class="layui-icon layui-icon-export"></i>
                                    <div class="layui-inline" style="font-size: small;text-align:center;margin-top: -3px">新 增</div>
                                </button>
                            </div>

                    </div>
                    <%-----------老人信息显示-----------%>
                    <table class="layui-hide" id="elderInfoList" lay-filter="elder" ></table>
                </div>
                <%-----------历史变更信息-----------%>
                <div id="ElderInfoChangedDiv" class="layui-tab-item">
                    <%-----------搜索 & 文件导出 功能-----------%>
                    <div class="SearchLoadElder" style="font-size: small">
                        <%------------搜索功能---------------%>
                        老人姓名：
                        <div class="layui-inline">
                            <input class="layui-input" name="nameSearch" id="nameSearch" autocomplete="off" style="height: 30px;width:100px;margin-right: 10px">
                        </div>
                        医保ID：
                        <div class="layui-inline">
                            <input class="layui-input" name="ybidSearch" id="ybidSearch" autocomplete="off" style="height: 30px;width:100px;margin-right: 10px">
                        </div>
                        变更字段名称：
                        <div class="layui-input-inline layui-form" style="width: 150px">
                            <input class="layui-input" name="titleSearch" id="titleSearch" autocomplete="off" style="height: 30px;width:100px;margin-right: 10px">
                        </div>

                        <div class="layui-inline">
                            <button class="searchBtn" data-type="reload2" style="margin-left:10px;height:30px;width:85px;background-color: #009688;color: white;border: none;border-radius: 5px">
                                <i class="layui-icon layui-icon-search"></i>
                                <div class="layui-inline" style="font-size: small;text-align:center;margin-top: -3px;margin-left: 5px;margin-right: 5px">搜 索</div>
                            </button>
                        </div>
                        <%-------------文件导出-------------%>
                        <div class="layui-inline" style="float: right">
                            <button class="layui-btn layui-btn-sm" id="exportChangedExcel" name="exportChangedExcel" style="width: 100px;float: right;border-radius: 5px;margin-left: 5px">
                                <i class="layui-icon layui-icon-export"></i>
                                <div class="layui-inline" style="font-size: small;text-align:center;margin-top: -3px">导出文件</div>
                            </button>
                        </div>
                    </div>
                    <%-----------变更表格显示----------%>
                    <table class="layui-hide" id="elderInfoChangedList" lay-filter="elderChanged" ></table>
                </div>
            </div>
        </div>
    </div>
    <%--底部--%>
    <div id="footer"></div>
    <%--<script src="${webPath}/js/permission/auth/permList.js"></script>--%>
    <script src="${webPath}/js/largescreen/echarts.min.js"></script>
    <script>
        $("#header").load("${webPath}/publicPages/permission/fragments/header.jsp");
        $("#footer").load("${webPath}/publicPages/permission/fragments/footer.jsp");
    </script>

    <!------------ 老人信息表格 ---------->
    <script type="text/javascript" src="${webPath}/js/basicInfo/ElderInfo.js"></script>
    <%-------------编辑删除框--------------%>
    <%--查看页面的编辑框--%>
    <script type="text/html" id="Check_Edit_Del">
        <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>
        <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>

    </script>
    <%--历史变更页面的编辑框--%>
    <script type="text/html" id="Check">
        <a class="layui-btn layui-btn-xs" lay-event="detail" style="margin-top: 5px">查看</a>
    </script>
    <script type="text/javascript" src="${path}/lib/jquery-3.3.1.min.js"></script>

    <%-------------- 信息页面查看功能---------------%>
    <script type="text/javascript" src="${webPath}/js/utils.js"></script>
    <div class="elderDetail" id="ElderDetail" style="display: none">
        <form class="layui-form layui-form-pane" style="margin-top: 20px;margin-left: 10px;margin-right: 10px;">
            <div class="layui-form-item">
                <div class="layui-col-xs6">
                    <label class="layui-form-label">姓名</label>
                    <div class="layui-input-block">
                        <input type="text" name="name" value={name} class="layui-input" readonly="readonly">
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <label class="layui-form-label">性别</label>
                    <div class="layui-input-block">
                        <input type="text" name="gender" value={gender} class="layui-input" readonly="readonly">
                    </div>
                </div>
            </div>
            <div class="layui-form-item"><%--ok--%>
                <label class="layui-form-label">身份证号</label>
                <div class="layui-input-block">
                    <input type="text" name="id_number" value={id_number} class="layui-input" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-col-xs6">
                    <label class="layui-form-label">年龄</label>
                    <div class="layui-input-block">
                        <input type="text" name="title" autocomplete="off" value={age} class="layui-input" readonly="readonly">
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <label class="layui-form-label">等级</label>
                    <div class="layui-input-block">
                        <input type="text" name="person_level" value={person_level} class="layui-input" readonly="readonly">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-col-xs6">
                    <label class="layui-form-label">社保卡号</label>
                    <div class="layui-input-block">
                        <input type="text" name="sbcard_id" value={sbcard_id} class="layui-input" readonly="readonly">
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <label class="layui-form-label">医保ID</label>
                    <div class="layui-input-block">
                        <input type="text" name="ybid" value={ybid} class="layui-input" readonly="readonly">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-col-xs6">
                    <label class="layui-form-label">结算代码</label>
                    <div class="layui-input-block">
                        <input type="text" name="js_id" value={js_id} class="layui-input" readonly="readonly">
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <label class="layui-form-label">人员性质</label>
                    <div class="layui-input-block">
                        <input type="text" name="person_catagory" value={person_catagory} class="layui-input" readonly="readonly">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-col-xs6">
                    <label class="layui-form-label">联系方式</label>
                    <div class="layui-input-block">
                        <input type="text" name="phone_number" value={phone_number} class="layui-input" readonly="readonly">
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <label class="layui-form-label">联系人</label>
                    <div class="layui-input-block">
                        <input type="text" name="contact_people" value={contact_people} class="layui-input" readonly="readonly">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">护理员</label>
                <div class="layui-input-block">
                    <input type="text" name="care_assistant" value={care_assistant} class="layui-input" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;">上一家服务机构</label>
                <div class="layui-input-block">
                    <input style="height: 55px" type="text" name="last_serv_org" value={last_serv_org} class="layui-input" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">服务机构</label>
                <div class="layui-input-block" >
                    <input type="text" name="serv_org" value={serv_org} class="layui-input" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">服务地址</label>
                <div class="layui-input-block" >
                    <input type="text" name="fwaddress" value={fwaddress} class="layui-input" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;" >接受服务地址所在村居</label>
                <div class="layui-input-block">
                    <input style="height: 55px;" type="text" name="fwaddresscj" value={fwaddresscj} class="layui-input" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item" >
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;">接受服务地址所在街镇</label>
                <div class="layui-input-block">
                    <input style="height: 55px" type="text" name="fwjz" value={fwjz} class="layui-input" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;" >待遇起始日</label>
                <div class="layui-input-block">
                    <input style="height: 55px;" type="date" name="daiyu_start_date" value={daiyu_start_date} class="layui-input" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;" >待遇到期日</label>
                <div class="layui-input-block">
                    <input style="height: 55px;" type="date" name="daiyu_due_date" value={daiyu_due_date} class="layui-input" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-col-xs6">
                    <label class="layui-form-label">服务状态</label>
                    <div class="layui-input-block">
                        <input type="text" name="ser_situation" value={ser_situation} class="layui-input" readonly="readonly">
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <label class="layui-form-label">评估类型</label>
                    <div class="layui-input-block">
                        <input type="text" name="assess_type" value={assess_type} class="layui-input" readonly="readonly">
                    </div>
                </div>
            </div>
        </form>
    </div>
    <%------------- 老人信息新增 ------------%>
    <div class="editElder" id="ElderAdd" style="display: none;">
        <form class="layui-form layui-form-pane" style="margin-top: 20px;margin-left: 10px;margin-right: 10px;">
            <div class="layui-form-item">
                <div class="layui-col-xs6 ">
                    <label class="layui-form-label" ><div class="layui-inline"style="color: red">*</div>姓名</label>
                    <div class="layui-input-block">
                        <input type="text" name="name" value={name} lay-verify="required" class="layui-input">
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>性别</label>
                    <div class="layui-input-block">
                        <input type="text" name="gender" value={gender} lay-verify="required" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-col-xs6">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>年龄</label>
                    <div class="layui-input-block">
                        <input type="text" name="age" value={age} lay-verify="required" class="layui-input">
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>等级</label>
                    <div class="layui-input-block">
                        <select name="person_level" id="person_level">
                            <option value="一级" {select1}>一级</option>
                            <option value="二级" {select2}>二级</option>
                            <option value="三级" {select3}>三级</option>
                            <option value="四级" {select4}>四级</option>
                            <option value="五级" {select5}>五级</option>
                            <option value="六级" {select6}>六级</option>
                        </select>
                        <%--<input type="text" name="person_level" value={person_level} lay-verify="required" class="layui-input">--%>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>身份证号</label>
                <div class="layui-input-block">
                    <input type="text" name="id_number" value={id_number} lay-verify="required|identity" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-col-xs6">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>社保卡号</label>
                    <div class="layui-input-block">
                        <input type="text" name="sbcard_id" value={sbcard_id} lay-verify="required" class="layui-input">
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>医保ID</label>
                    <div class="layui-input-block">
                        <input type="text" name="ybid" value={ybid} lay-verify="required" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-col-xs6">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>结算代码</label>
                    <div class="layui-input-block">
                        <input type="text" name="js_id" value={js_id} lay-verify="required" class="layui-input">
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>人员性质</label>
                    <div class="layui-input-block">
                        <select name="person_catagory" id="person_catagory">
                            <option value="居保" {select7}>居保</option>
                            <option value="城保" {select8}>城保</option>
                            <option value="离休干部" {select9}>离休干部</option>
                            <option value="革命伤残军人" {select10}>革命伤残军人</option>
                            <option value="帮困" {select11}>帮困</option>
                        </select>
                        <%--<input type="text" name="person_catagory" value={person_catagory} lay-verify="required" class="layui-input">--%>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-col-xs6">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>联系方式</label>
                    <div class="layui-input-block">
                        <input type="text" name="phone_number" value={phone_number} lay-verify="required|phone" class="layui-input">
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>联系人</label>
                    <div class="layui-input-block">
                        <input type="text" name="contact_people" value={contact_people} lay-verify="required" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">护理员</label>
                <div class="layui-input-block">
                    <input type="text" name="care_assistant" value={care_assistant} class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;">上一家服务机构</label>
                <div class="layui-input-block">
                    <input style="height: 55px" type="text" name="last_serv_org" value={last_serv_org} class="layui-input" >
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>服务机构</label>
                <div class="layui-input-block" >
                    <input type="text" name="serv_org" value={serv_org} lay-verify="required" class="layui-input" >
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>居住地址</label>
                <div class="layui-input-block" >
                    <input type="text" name="fwaddress" value={fwaddress} class="layui-input" lay-verify="required">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;" >接受服务地址所在村居</label>
                <div class="layui-input-block">
                    <input style="height: 55px;" type="text" name="fwaddresscj" value={fwaddresscj} class="layui-input">
                </div>
            </div>
            <div class="layui-form-item" >
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;">接受服务地址所在街镇</label>
                <div class="layui-input-block">
                    <%--<input style="height: 55px" type="text" name="fwjz" value={fwjz} class="layui-input">--%>
                        <select name="fwjz" id="fwjz">
                            <option value="马陆镇" >----请选择街镇----</option>
                            <option value="马陆镇" >马陆镇</option>
                            <option value="南翔镇" >南翔镇</option>
                            <option value="江桥镇" }>江桥镇</option>
                            <option value="真新街道" >真新街道</option>
                            <option value="安亭镇" >安亭镇</option>
                            <option value="外冈镇" >外冈镇</option>
                            <option value="徐行镇" >徐行镇</option>
                            <option value="华亭镇" >华亭镇</option>
                            <option value="嘉定工业区" }>嘉定工业区</option>
                            <option value="嘉定镇街道" >嘉定镇街道</option>
                            <option value="新成路街道" >新成路街道</option>
                            <option value="菊园新区" >菊园新区</option>
                        </select>

                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;" >待遇起始日</label>
                <div class="layui-input-block">
                    <input style="height: 55px;" type="date" name="daiyu_start_date" value={daiyu_start_date} class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;" >待遇到期日</label>
                <div class="layui-input-block">
                    <input style="height: 55px;" type="date" name="daiyu_due_date" value={daiyu_due_date} class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-col-xs6">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>服务状态</label>
                    <div class="layui-input-block">
                        <select name="ser_situation" id="ser_situation">
                            <option value="有效正常" {select12}>有效正常</option>
                            <option value="有效暂停" {select13}>有效暂停</option>
                            <option value="无效去世" {select14}>无效去世</option>
                            <option value="无效转出" {select15}>无效转出</option>
                        </select>
                        <%--<input type="text" name="ser_situation" value={ser_situation} lay-verify="required" class="layui-input">--%>
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>评估类型</label>
                    <div class="layui-input-block">
                        <select name="assess_type" id="assess_type">
                            <option value="初次评估" {select16}>初次评估</option>
                            <option value="状态评估" {select17}>状态评估</option>
                            <option value="期末评估" {select18}>期末评估</option>
                            <option value="复核评估" {select19}>复核评估</option>
                        </select>
                        <%--<input type="text" name="assess_type" value={assess_type} lay-verify="required" class="layui-input">--%>
                    </div>
                </div>
            </div>
            <div class="layui-form-item" style="display: none">
                <label class="layui-form-label">序号</label>
                <div class="layui-input-block">
                    <input type="text" name="id" value={id} class="layui-input" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item" align="center" style="margin-top: 20px;margin-bottom: 20px">
                <button type="submit" class="layui-btn" lay-submit="" id="handAdd" lay-filter="handAdd" style="margin-right: 20px">
                    <div style="font-weight: bold;font-size: medium">立 即 提 交</div>
                </button>
                <button class="layui-btn layui-btn-primary" style="width:100px" type="button">
                    <div style="font-weight: bold;font-size: medium" onclick="javascript:history.go(-1)">取&nbsp&nbsp&nbsp&nbsp消</div>
                </button>
            </div>
        </form>
    </div>
    <%------------- 信息页面修改用户信息 ------------%>
    <div class="editElder" id="ElderEdit" style="display: none;">
        <form class="layui-form layui-form-pane" style="margin-top: 20px;margin-left: 10px;margin-right: 10px;">
            <div class="layui-form-item">
                <div class="layui-col-xs6 ">
                    <label class="layui-form-label" ><div class="layui-inline"style="color: red">*</div>姓名</label>
                    <div class="layui-input-block">
                        <input type="text" name="name" value={name} lay-verify="required" class="layui-input">
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>性别</label>
                    <div class="layui-input-block">
                        <input type="text" name="gender" value={gender} lay-verify="required" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-col-xs6">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>年龄</label>
                    <div class="layui-input-block">
                        <input type="text" name="age" value={age} lay-verify="required" class="layui-input">
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>等级</label>
                    <div class="layui-input-block">
                        <select name="person_level" id="person_level">
                            <option value="一级" {select1}>一级</option>
                            <option value="二级" {select2}>二级</option>
                            <option value="三级" {select3}>三级</option>
                            <option value="四级" {select4}>四级</option>
                            <option value="五级" {select5}>五级</option>
                            <option value="六级" {select6}>六级</option>
                        </select>
                        <%--<input type="text" name="person_level" value={person_level} lay-verify="required" class="layui-input">--%>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>身份证号</label>
                <div class="layui-input-block">
                    <input type="text" name="id_number" value={id_number} lay-verify="required|identity" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-col-xs6">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>社保卡号</label>
                    <div class="layui-input-block">
                        <input type="text" name="sbcard_id" value={sbcard_id} lay-verify="required" class="layui-input">
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>医保ID</label>
                    <div class="layui-input-block">
                        <input type="text" name="ybid" value={ybid} lay-verify="required" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-col-xs6">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>结算代码</label>
                    <div class="layui-input-block">
                        <input type="text" name="js_id" value={js_id} lay-verify="required" class="layui-input">
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>人员性质</label>
                    <div class="layui-input-block">
                        <select name="person_catagory" id="person_catagory">
                            <option value="居保" {select7}>居保</option>
                            <option value="城保" {select8}>城保</option>
                            <option value="离休干部" {select9}>离休干部</option>
                            <option value="革命伤残军人" {select10}>革命伤残军人</option>
                            <option value="帮困" {select11}>帮困</option>
                        </select>
                        <%--<input type="text" name="person_catagory" value={person_catagory} lay-verify="required" class="layui-input">--%>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-col-xs6">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>联系方式</label>
                    <div class="layui-input-block">
                        <input type="text" name="phone_number" value={phone_number} lay-verify="required|phone" class="layui-input">
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>联系人</label>
                    <div class="layui-input-block">
                        <input type="text" name="contact_people" value={contact_people} lay-verify="required" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">护理员</label>
                <div class="layui-input-block">
                    <input type="text" name="care_assistant" value={care_assistant} class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;">上一家服务机构</label>
                <div class="layui-input-block">
                    <input style="height: 55px" type="text" name="last_serv_org" value={last_serv_org} class="layui-input" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>服务机构</label>
                <div class="layui-input-block" >
                    <input type="text" name="serv_org" value={serv_org} lay-verify="required" class="layui-input" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>居住地址</label>
                <div class="layui-input-block" >
                    <input type="text" name="fwaddress" value={fwaddress} class="layui-input" lay-verify="required">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;" >接受服务地址所在村居</label>
                <div class="layui-input-block">
                    <input style="height: 55px;" type="text" name="fwaddresscj" value={fwaddresscj} class="layui-input">
                </div>
            </div>
            <div class="layui-form-item" >
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;">接受服务地址所在街镇</label>
                <div class="layui-input-block">
                    <input style="height: 55px" type="text" name="fwjz" value={fwjz} class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;" >启变日期</label>
                <div class="layui-input-block">
                    <input style="height: 55px;" type="date" name="start_change_date" value={start_change_date} class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;" >待遇起始日</label>
                <div class="layui-input-block">
                    <input style="height: 55px;" type="date" name="daiyu_start_date" value={daiyu_start_date} class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;" >待遇到期日</label>
                <div class="layui-input-block">
                    <input style="height: 55px;" type="date" name="daiyu_due_date" value={daiyu_due_date} class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-col-xs6">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>服务状态</label>
                    <div class="layui-input-block">
                        <select name="ser_situation" id="ser_situation">
                            <option value="有效正常" {select12}>有效正常</option>
                            <option value="有效暂停" {select13}>有效暂停</option>
                            <option value="无效去世" {select14}>无效去世</option>
                            <option value="无效转出" {select15}>无效转出</option>
                        </select>
                        <%--<input type="text" name="ser_situation" value={ser_situation} lay-verify="required" class="layui-input">--%>
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>评估类型</label>
                    <div class="layui-input-block">
                        <select name="assess_type" id="assess_type">
                            <option value="初次评估" {select16}>初次评估</option>
                            <option value="状态评估" {select17}>状态评估</option>
                            <option value="期末评估" {select18}>期末评估</option>
                            <option value="复核评估" {select19}>复核评估</option>
                        </select>
                        <%--<input type="text" name="assess_type" value={assess_type} lay-verify="required" class="layui-input">--%>
                    </div>
                </div>
            </div>
            <div class="layui-form-item" style="display: none">
                <label class="layui-form-label">序号</label>
                <div class="layui-input-block">
                    <input type="text" name="id" value={id} class="layui-input" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item" align="center" style="margin-top: 20px;margin-bottom: 20px">
                <button type="submit" class="layui-btn" lay-submit="" id="handin" lay-filter="handin" style="margin-right: 20px">
                    <div style="font-weight: bold;font-size: medium">立 即 提 交</div>
                </button>
                <button class="layui-btn layui-btn-primary" style="width:100px" type="button">
                    <div style="font-weight: bold;font-size: medium" onclick="javascript:history.go(-1)">取&nbsp&nbsp&nbsp&nbsp消</div>
                </button>
            </div>
        </form>
    </div>

    <%--老人新增Js--%>
    <script>
        layui.use('form', function(){
            var form = layui.form
            form.on('submit(handAdd)', function(data){
                console.log("开始提交");
                console.log(data.field)
                $.ajax({
                    url:'/elderInfo/AddElder',
                    method:'POST',
                    data:data.field,
                    dataType:'JSON',
                    success:function(res){
                        console.log(res.msg);
                        if(res.msg=="ok"){
                            console.log("成功提交"+data.field);
                            layer.msg("提交成功",{icon: 1, time: 1500},function(){location.reload();}); //提交成功后刷新页面
                        }else{
                            console.log("请确保“医保ID”输入正确"+data.field);
                            layer.msg("请确保“医保ID”输入正确",{icon:5,anim:6,offset: "auto"})
                        }
                    },
                    error:function (data) {
                        console.log("提交失败",data);
                        console.log("表单提交错误");
                    }
                });
                return false;
            })
        })
    </script>

    <script>
        layui.use('form', function(){
            var form = layui.form
            form.on('submit(handin)', function(data){
                console.log("开始提交");
                console.log(data.field)
                $.ajax({
                    url:'/elderInfo/updateElder',
                    method:'POST',
                    data:data.field,
                    dataType:'JSON',
                    success:function(res){
                        console.log(res.msg);
                        if(res.msg=="ok"){
                            console.log("成功提交"+data.field);
                            layer.msg("提交成功",{icon: 1, time: 1500},function(){location.reload();}); //提交成功后刷新页面
                        }else{
                            console.log("请确保“医保ID”输入正确"+data.field);
                            layer.msg("请确保“医保ID”输入正确",{icon:5,anim:6,offset: "auto"})
                        }
                    },
                    error:function (data) {
                        console.log("提交失败",data);
                        console.log("表单提交错误");
                    }
                });
                return false;
            })
        })
    </script>

    <%-------------- 历史变更页面查看功能---------------%>
    <div class="elderDetailChanged" id="ElderDetailChanged" style="display: none">
        <form class="layui-form layui-form-pane" style="margin-top: 20px;margin-left: 10px;margin-right: 10px;">
            <div class="layui-form-item">
                <label class="layui-form-label" >姓名</label>
                <div class="layui-input-block">
                    <input type="text" name="name" value={name} class="layui-input" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">医保卡号</label>
                <div class="layui-input-block">
                    <input type="text" step="1" name="ybid" value={ybid} class="layui-input" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">变更时间</label>
                <div class="layui-input-block">
                    <input type="datetime-local" step="1" name="history_change_time" value={history_change_time} class="layui-input" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">启变日期</label>
                <div class="layui-input-block">
                    <input type="date" step="1" name="start_change_date" value={start_change_date} class="layui-input" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;">变更内容名称</label>
                <div class="layui-input-block">
                    <input type="text" style="height: 55px;" step="1" name="changed_title" value={changed_title} class="layui-input" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;">变更前的内容</label>
                <div class="layui-input-block">
                    <input type="text" style="height: 55px;" step="1" name="history_content" value={history_content} class="layui-input" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;">变更后的内容</label>
                <div class="layui-input-block">
                    <input type="text" style="height: 55px;" step="1" name="new_content" value={new_content} class="layui-input" readonly="readonly">
                </div>
            </div>
        </form>
    </div>

    <%------------------- 信息页面 EXCEL 文件上传------------------%>
    <script type="text/javascript">
        layui.use('upload', function(){
            var $ = layui.jquery
                ,upload = layui.upload;
            upload.render({
                elem: '#uploadExcel'
                ,url: '/elderInfo/InputExcel' //改成您自己的上传接口
                ,accept: 'file' //普通文件
                ,exts: 'xls|xlsx' //只允许上传压缩文件
                ,done: function(res){
                    console.log(res);
                    if(res.msg=="ok"){
                        layer.msg("文件导入成功",{icon: 1, time: 1500},function(){location.reload();});
                        // alert("文件导入成功");
                    }else{
                        layer.msg("文件导入失败",{icon: 2, time: 1500},function(){location.reload();});
                        // alert("文件导入失败失败");
                    }
                }
                ,error:function(){
                    layer.msg("文件导入失败",{icon: 2, time: 1500},function(){location.reload();});
                }
            });
        })
    </script>

    <%------------------- 信息页面 EXCEL 文件导出------------------%>
    <script type="text/javascript">
        layui.config({//配置并导入excel插件
            base: '${base}/js/layui_exts/'
        }).use([ 'excel', 'layer'], function() {
            var $ = layui.$;
            var layer = layui.layer;
            var excel = layui.excel;
            $('#exportExcel').on('click', function(){
                console.log("触发导出按钮");
                var send_name = $('#name');
                var send_org = $('#serv_org');
                var send_ybid = $('#ybid');
                var send_person_level = $('#level');
                var send_person_catagory = $('#catagory');
                var send_assess_type = $('#type');
                var send_ser_situation = $('#situation');
                layer.confirm('是否确认导出', function(index) {
                    $.ajax({
                        url: '/elderInfo/ExportAllInfo'
                        ,method:'post'
                        ,data:{
                            name: send_name.val(),
                            serv_org:send_org.val(),
                            ybid:send_ybid.val(),
                            person_level:send_person_level.val(),
                            person_catagory:send_person_catagory.val(),
                            assess_type:send_assess_type.val(),
                            ser_situation:send_ser_situation.val()
                        }
                        , dataType: 'json'
                        , success(res) {
                            var data = res;
                            console.log(res);
                            layer.close(index);
                            data = excel.filterExportData(data, [
                                'serv_org', 'js_id', 'name', 'gender', 'age','person_level'
                                , 'sbcard_id', 'ybid', 'id_number', 'person_catagory'
                                , 'phone_number', 'contact_people','care_assistant','fwaddress'
                                , 'fwaddresscj', 'fwjz', 'daiyu_start_date', 'daiyu_due_date',
                                , 'ser_situation', 'assess_type','last_serv_org'
                            ]);
                            data.unshift({
                                serv_org: "机构名称", js_id: "结算ID", name: '姓名', gender: "性别",age: "年龄",
                                person_level: "等级", sbcard_id: '社保卡ID', ybid: "医保ID", id_number: '身份证号',
                                person_catagory: "人员性质", phone_number: "联系方式", contact_people: "联系人",
                                care_assistant: "护理人员", fwaddress: '接收服务地址', fwaddresscj: "接受服务地址所在村居",
                                fwjz: '接受服务地址所在街镇', daiyu_start_date: "待遇起始日", daiyu_due_date: "待遇到期日"
                                , ser_situation: "服务状态", assess_type: "评估类型",last_serv_org:"上一家服务机构"
                            });
                            excel.exportExcel(data, '老人信息导出--' + new Date().toLocaleString() + '.xlsx', 'xlsx');
                        }
                        , error() {
                            layer.alert('获取数据失败，请检查是否部署在本地服务器环境下');
                        }
                    });
                });
            });
        });
    </script>

    <%------------------- 变更页面 EXCEL 文件导出------------------%>
    <script type="text/javascript">
        layui.config({//配置并导入excel插件
            base: '${base}/js/layui_exts/'
        }).use([ 'excel', 'layer'], function() {
            var $ = layui.$;
            var layer = layui.layer;
            var excel = layui.excel;
            $('#exportChangedExcel').on('click', function(){
                console.log("触发导出按钮");
                var send_name = $('#nameSearch');
                var send_code = $('#ybidSearch');
                var send_title=$('#titleSearch');
                console.log("导出：搜索的机构是"+send_name.val());
                console.log("导出：搜索的结算代码是"+send_code.val());
                console.log("导出：搜索的名称是"+send_title.val());
                layer.confirm('是否确认导出', function(index) {
                    $.ajax({
                        url: '/elderInfo/ExportAllChangedInfo'
                        ,method:'post'
                        ,data: {
                            nameSearch: send_name.val(),
                            ybidSearch: send_code.val(),
                            titleSearch:send_title.val()
                        }
                        , dataType: 'json'
                        , success(res) {
                            var data = res;
                            console.log(res);
                            layer.close(index);
                            data = excel.filterExportData(data, [
                                'name'
                                , 'ybid'
                                , 'history_change_time'
                                , 'changed_title'
                                , 'history_content'
                                , 'new_content'
                            ]);
                            data.unshift({
                                name: "老人姓名", ybid: "医保ID",
                                history_change_time: "修改时间",changed_title:"变更字段名称",
                                history_content:"变更前内容",new_content:"变更后内容"
                            });
                            excel.exportExcel(data, '服务机构变更信息导出--' + new Date().toLocaleString() + '.xlsx', 'xlsx');
                        }
                        , error() {
                            layer.alert('获取数据失败，请检查是否部署在本地服务器环境下');
                        }
                    });
                });
            });
        });
    </script>

</div>
</body>
</html>
